package cn.edu.zjut.mina.service.impl;

import java.util.List;
import java.util.Random;

import org.apache.mina.core.session.IoSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import cn.edu.zjut.mina.bean.Card;
import cn.edu.zjut.mina.bean.RoomInfo_XCMJ;
import cn.edu.zjut.mina.bean.StandardFormat;
import cn.edu.zjut.mina.bean.UserSession;
import cn.edu.zjut.mina.interf.IRoomInfo;
import cn.edu.zjut.mina.repository.UserInfoRepository;
import cn.edu.zjut.mina.service.IEveryGameBeginService;
import cn.edu.zjut.mina.service.IGameOverService;
import cn.edu.zjut.mina.service.INotificationService;
import cn.edu.zjut.mina.util.UserSessionMap;
import cn.edu.zjut.mina.xcmahjong.XcmjGame;

public class EveryGameBeginServiceImpl_xcmj implements IEveryGameBeginService{

	/**
	 * 用于存放用户信息的集合
	 */
	private final UserSessionMap userSessionMap = UserSessionMap.getInstance();
	
	@Qualifier("notificationService")
	@Autowired
	private INotificationService notificationService;
	
	@Qualifier("gameOverService")
	@Autowired
	private IGameOverService gameOverService;
	
	@Autowired
	private UserInfoRepository userInfoRepository;
	private IRoomInfo roomInfo;
	private List<UserSession> playerSessionList;

	public void deal(StandardFormat inJson, IoSession session) {
		// TODO Auto-generated method stub
		
	}

	public void start(StandardFormat inJson, IoSession session) {
		// TODO Auto-generated method stub
		 roomInfo=userSessionMap.get(inJson.roomId);
		 XcmjGame xcmjGame=(XcmjGame) roomInfo.getGame();
		 xcmjGame.init();
	}

}
